package com.rcloud.stock.database;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

@Dao
public interface HistoryDao {
    @Insert(onConflict = OnConflictStrategy.IGNORE)
    void insertHistories(History... histories);
    @Delete
    void deleteHistories(History... histories);
    @Update
    void updateHistories(History... histories);
    @Query("select * from history order by id desc limit 10")
    LiveData<List<History>> getHistories();
}
